<template>
  <div class="collect-preview">
    <div v-html="webInfo"></div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      listQuery: {},
      webInfo: '',
    }
  },
  mounted() {
    this.listQuery = this.$route.query.data
    this.getWebInfo()
  },
  methods: {
    async getWebInfo() {
      let res = await this.$store.dispatch(
        'previewTestPaper',
        JSON.parse(this.listQuery),
      )
      this.webInfo = res.data[0] || '<h4>抱歉，未能预览到数据</h4>'
    },
  },
}
</script>
<style scoped lang="scss">
.collect-preview {
  padding: 10px;
}
</style>